﻿<%@ Page Title="" Language="C#" MasterPageFile="~/PageTemplate.Master" AutoEventWireup="true" CodeBehind="CreateAccount.aspx.cs" Inherits="RMS.Pages.CreateAccount" %>
<asp:Content ID="Content1" ContentPlaceHolderID="BodyContent" runat="server">
    <h1>Account Creation</h1>
    <hr />
    <br />
    <table class="CreateAccountTable">
        <tr>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="FName">First Name:</asp:Label></td>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="LName">Last Name:</asp:Label></td>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="MInt">Middle Initial:</asp:Label></td>
        </tr>
        <tr>
            <td><asp:TextBox runat="server" ID="FName" class="lettersOnly" /></td>
            <td><asp:TextBox runat="server" ID="LName" class="lettersOnly" /></td>
            <td><asp:TextBox runat="server" ID="MInt" Width="15px" class="lettersOnly" /></td>
        </tr>
        <tr>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="FName" CssClass="inputError" ErrorMessage="Your first name is required." /></td>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="LName" CssClass="inputError" ErrorMessage="Your last name is required" /></td>
        </tr>
        <tr>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="Email">E-mail Address:</asp:Label></td>
        </tr>
        <tr>
            <td><asp:TextBox runat="server" ID="Email" /></td>
            <td>
               <span class="greentext">&#8226;<i> Your login name</i></span>
            </td>
            <td><asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server"
            ControlToValidate="Email" ErrorMessage="Please enter correct email address"
            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"></asp:RegularExpressionValidator></td>
        </tr>
        <tr>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="Email" CssClass="inputError" ErrorMessage="Your email address is required" /></td>
        </tr>
        <tr>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="Address">Street Address:</asp:Label></td>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="City">City:</asp:Label></td>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="State">State:</asp:Label></td>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="Zip" >Zipcode:</asp:Label></td>
        </tr>
        <tr>
            <td><asp:TextBox runat="server" ID="Address" /></td>
            <td><asp:TextBox runat="server" ID="City" class="lettersOnly" /></td>
            <td>
                <asp:DropDownList ID="State" runat="server">
                    <asp:ListItem Value="WI"/>
                    <asp:ListItem Value="AL"/>
                    <asp:ListItem Value="AK"/>
                    <asp:ListItem Value="AZ"/>
                    <asp:ListItem Value="AR"/>
                    <asp:ListItem Value="CA"/>
                    <asp:ListItem Value="CO"/>
                    <asp:ListItem Value="CT"/>
                    <asp:ListItem Value="DC"/>
                    <asp:ListItem Value="DE"/>
                    <asp:ListItem Value="FL"/>
                    <asp:ListItem Value="GA"/>
                    <asp:ListItem Value="HI"/>
                    <asp:ListItem Value="ID"/>
                    <asp:ListItem Value="IL"/>
                    <asp:ListItem Value="IN"/>
                    <asp:ListItem Value="IA"/>
                    <asp:ListItem Value="KS"/>
                    <asp:ListItem Value="KY"/>
                    <asp:ListItem Value="LA"/>
                    <asp:ListItem Value="ME"/>
                    <asp:ListItem Value="MD"/>
                    <asp:ListItem Value="MA"/>
                    <asp:ListItem Value="MI"/>
                    <asp:ListItem Value="MN"/>
                    <asp:ListItem Value="MS"/>
                    <asp:ListItem Value="MO"/>
                    <asp:ListItem Value="MT"/>
                    <asp:ListItem Value="NE"/>
                    <asp:ListItem Value="NV"/>
                    <asp:ListItem Value="NH"/>
                    <asp:ListItem Value="NJ"/>
                    <asp:ListItem Value="NM"/>
                    <asp:ListItem Value="NY"/>
                    <asp:ListItem Value="NC"/>
                    <asp:ListItem Value="ND"/>
                    <asp:ListItem Value="OH"/>
                    <asp:ListItem Value="OK"/>
                    <asp:ListItem Value="OR"/>
                    <asp:ListItem Value="PA"/>
                    <asp:ListItem Value="RI"/>
                    <asp:ListItem Value="SC"/>
                    <asp:ListItem Value="SD"/>
                    <asp:ListItem Value="TN"/>
                    <asp:ListItem Value="TX"/>
                    <asp:ListItem Value="UT"/>
                    <asp:ListItem Value="VT"/>
                    <asp:ListItem Value="VA"/>
                    <asp:ListItem Value="WA"/>
                    <asp:ListItem Value="WV"/>
                    <asp:ListItem Value="WI"/>
                    <asp:ListItem Value="WY"/>
                </asp:DropDownList>
            </td>
            <td><asp:TextBox runat="server" ID="Zip" class="numbersOnly" /></td>
        </tr>
        <tr>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="Address" CssClass="inputError" ErrorMessage="Your street address is required." /></td>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="City" CssClass="inputError" ErrorMessage="Your city is required" /></td>
            <td></td>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="Zip" CssClass="inputError" ErrorMessage="Your zip code is required" /></td>
        </tr>
        <tr>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="Phone" >Phone Number:</asp:Label></td>
        </tr>
        <tr>
            <td>
                <asp:TextBox runat="server" TextMode="Phone" ID="Phone" class="numbersOnly" />
            </td>
            <td>
                <span class="greentext">&#8226;<i> Include area code</i></span>
            </td>
        </tr>
        <tr>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="Phone" CssClass="inputError" ErrorMessage="Your phone number is required." /></td>
        </tr>
        <tr>
            <td><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="Password">Password:</asp:Label></td>
            
        </tr>
        <tr>
            <td>
                <asp:TextBox runat="server" TextMode="Password" ID="Password" />
            </td>
            <!--<td>*Note: Password must be between 7 and 10 characters long</td> -->
            <td>
                <span class="greentext">&#8226;<i> Password must be 7 to 10 characters long</i></span>
            </td>
            <td><asp:Label runat="server" ID="InvalidPasswordLabel"></asp:Label></td>
        </tr>
        <tr>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="Password" CssClass="inputError" ErrorMessage="A password is required." /></td>
        </tr>
        <tr>
            <td><i><asp:Label runat="server" CssClass="inputLabel" AssociatedControlID="RepPassword">Confirm Password:</asp:Label></i></td>
        </tr>
        <tr>
            <td><asp:TextBox runat="server" TextMode="Password" ID="RepPassword" /></td>
            <td><asp:Label runat="server" ID="PasswordWrong"></asp:Label></td>
        </tr>
        <tr>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate="RepPassword" CssClass="inputError" ErrorMessage="Please reenter your password." /></td>
        </tr>

        <% if (Session["IsAdmin"] == null || (bool)Session["IsAdmin"] == true)
                {
                    //if ((bool)Session["IsAdmin"] == false)
                    //{
                        //Response.Write("<td><asp:CheckBox runat=\"server\" Text=\"I accept the Terms of Service\" ID=\"TermsOfService\"/></td>");
                        //Response.Write("<td><asp:Label runat=\"server\" ID=\"AcceptTermsLabel\"></asp:Label></td>");
                    //}

                    //Response.Write("<tr><td><input id=\"IsAdmin\" type=\"checkbox\" />");
                    //Response.Write("<label for=\"IsAdmin\">Is this user going to be an admin?</label></td></tr>");
                }
            %>
       
            <% if (Session["IsAdmin"] == null || (bool)Session["IsAdmin"] == false)
                {
                    //if ((bool)Session["IsAdmin"] == false)
                    //{
                        //Response.Write("<td><asp:CheckBox runat=\"server\" Text=\"I accept the Terms of Service\" ID=\"TermsOfService\"/></td>");
                        //Response.Write("<td><asp:Label runat=\"server\" ID=\"AcceptTermsLabel\"></asp:Label></td>");
                    //}

                    //Response.Write("<td><input id=\"TermsOfService\" type=\"checkbox\" />");
                    //Response.Write("<label for=\"TermsOfService\">I accept the Terms of Service</label></td>");
                }
            %>
    </table>
       
    <table>
        <tr>
            <td>
                <br />
                <i><asp:CheckBox runat="server" Text="I accept the Terms of Service." ID="TermsOfService"/></i>
            </td>
            <td>
                <br />
                <span>&nbsp;</span>
                <asp:Label runat="server" CssClass="inputError" ID="AcceptTermsLabel"> </asp:Label>
            </td>
        </tr>
    </table>
    
    <br />
    <asp:Button ID="Button2" runat="server" CssClass="myButton" Text="Create Account" OnClick="CreateUserButtonClick" />

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="SidebarContent" runat="server">
    
</asp:Content>
